/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.math;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public abstract class Form2D extends Form {

    private Point2D location;

    public Form2D() {
        this("Form2D", 0, 0);
    }

    public Form2D(String name) {
        this(name, 0, 0);
    }

    public Form2D(String name, float x, float y) {
        this(name, new Point2D(x, y));
    }

    public Form2D(String name, Point2D location) {
        super(name);
        this.location = location;
    }
    
    public Point2D getLocation() {
        return location;
    }

    public void setLocation(Point2D location) {
        if( location!=null ) {
            this.location = location;
        } else {
            this.location = new Point2D();
        }
    }
    
    public float getX() {
        return this.getLocation().getX();
    }
    
    public float getY() {
        return this.getLocation().getY();
    }
    
    public abstract float getArea();
    
}
